<template>
	<view class="container">
		<!--头部start-->
		<view class="header">
			<u-status-bar></u-status-bar>
			<view class="my_header">
				<image src="/static/images/img_47.png" mode="heightFix"></image>
				<image src="/static/images/img_48.png" mode="heightFix"></image>
				<image src="/static/images/img_49.png" mode="heightFix"></image>
			</view>
		</view>
		<u-status-bar></u-status-bar>
		<!--头部end-->

			<!--我的start-->
			<view class="my_index">
				<view class="top">
					<!--<image src="/static/images/img_50.png" class="img"></image>-->
					<u-avatar shape="circle" size="114rpx" :src="src" default-url="/static/images/img_50.png" customStyle="margin-right:28rpx"></u-avatar>
					<view class="con">
						<view class="tit">138*****457<image src="/static/images/img_32.png"></image></view>
						<text>昵称：网赚极客</text>
						<text>级别：正式发布商</text>
						<image src="/static/images/img_51.png" mode="widthFix" class="star"></image>
					</view>
				</view>
				
				<view class="my_credit">信誉值<text>68.5</text></view>
				
				<view class="my_num">
					<view class="tops">
						<text>当前可用资产</text>
						<view class="adc_total">{{ moneyFormat('4,083') }} ADC</view>
						<view class="cny_total">≈{{ moneyFormat('26,947.80') }} CNY</view>
						<view class="eye" :class="[showPassword==true?'':'on']" :name="eyeIconName" @click="eyeIconName == 'eye-off' ? (eyeIconName = 'eye') : (eyeIconName = 'eye-off')"></view>
					</view>
					<view class="list">
						<view><image src="/static/images/img_60.png" mode="heightFix"></image>广告收益</view>
						<view><image src="/static/images/img_61.png" mode="heightFix"></image>市场奖励</view>
						<view><image src="/static/images/img_62.png" mode="heightFix"></image>资产明细</view>
					</view>
				</view>
				
				<view class="my_count">
					<view class="tits">我的收款账户</view>
					<view class="list">
						<view class="d_img">
							<view><image src="/static/images/img_63.png"></image></view>
						</view>
						<view class="d_img">
							<view><image src="/static/images/img_64.png"></image></view>
						</view>
						<view class="d_img">
							<view><image src="/static/images/img_65.png"></image></view>
						</view>
					</view>
				</view>
				
			</view>
			<!--我的end-->
		
		
		<u-safe-bottom></u-safe-bottom>
		
	
	</view>
</template>

<script>
	import tab from "../index/tab.vue"
export default{
	components: {
	    /***** mescroll S *****/
	    //注册组件
		tab
	    /***** mescroll E *****/
	},
	data(){
		return{
			eyeIconName: 'eye',
			showPassword: false,
			src:"",
			tabBarId:4,
		}
	},
	methods: {
		changeName(idx){
			this.tabBarId=idx
		}
	},
	computed: {
		// 格式化金额，等位数转换为星
		moneyFormat(e) {
			return e => {
				if (e || e == 0) {
					e = e.toString();
				}
				if (e && this.eyeIconName == 'eye-off') {
					this.showPassword = true;
					let temp = [];
					e.split('').forEach(item => {
						temp.push('*');
				});
				return temp.join('');
				} else {
					this.showPassword =false;
					parseFloat(e)
					.toFixed(2)
					.replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
					return e;
				}
			};
		}
	},
}
</script>

<style lang="scss">
	@import url("../../common/style.scss");
	@import url("my.scss");
</style>